package jmercury;

import dblib.DB;
import dblib.PDM;

public class Logs {

    // Log types
    // 1 - err
    // 2 - system
    // 3 - user
    //
    public static void log(int LogType, String LogClass, String LogText) {
        PDM pdm = new PDM();
        String sql = "INSERT INTO logs (hostid, logtype, class, logtext, dt, hide) VALUES ("
                + "'" + DB.getHexString(Vars.getHostID()) + "', "
                + LogType + ", "
                + "'" + DB.getHexString(LogClass) + "', "
                + "'" + DB.getHexString(Vars.getVersion() + " - " + LogText) + "', "
                + "CURRENT_TIMESTAMP, "
                + "false)";
        pdm.executeNonQuery("log", sql);
    }
}
